home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Software
/
BUDGET-V2.SDA
/
BUDGET V.2
(
.txt
)
next >
Wrap
Commodore BASIC
|
2019-04-13
|
10KB
|
356 lines
5 REM" BUDGET V.2
10 [143]"(null)TANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANRIGHT$
15 REM"[221]THIS PROGRAM IS OFFERED TO[221] [221]PUBLIC DOMAIN - MARCH 1987[221]
20 [143]"(null) ROBERT A. LEDUC (null) (null) 61 WARREN AVENUE (null)
25 REM"[221] LEWISTON, MAINE 04240 [221] [221] ENJOY :) [221]
26 [143]"MID$TANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTAN(null)
30 PRINT"[147][155]":POKE53280,0:POKE53281,0
35 CT=0:CN=0:N=0:LM=0:NU=0
40 K$="":M$="":L$=""
45 N2=0:LN=0:BA=170
50 DIMT(40,2),C$(40),D(12,2)
55 FORN=1TO23:READQ:F=F+Q:NEXT
60 FORN=1TO40:READQ$:C$(N)=Q$:NEXT
65 GOTO160
70 PRINT"[147]":FORN=1TO20:IFN<10THENPRINT" ";
75 PRINT""N"[146][155]";LEFT$(C$(N),15);TAB(21)""N+20"[146][155]";LEFT$(C$(N+20),14)
80 NEXTN:RETURN
85 PRINT"[155][147]LOADING ACCOUNT ";RIGHT$(D$,4)
90 PRINT"PLEASE WAIT..."
95 OPEN15,8,15
100 GOSUB1440
105 OPEN2,8,2,"BUDGET DATA "+RIGHT$(D$,2)+",S,R"
110 FORN=1TO40:INPUT#2,T(N,1):NEXT:GOSUB1440
115 FORN=1TO40:INPUT#2,T(N,2):NEXT:GOSUB1440
120 FORN=1TO12:INPUT#2,D(N,1):NEXT:GOSUB1440
125 FORN=1TO12:INPUT#2,D(N,2):NEXT:GOSUB1440
130 CLOSE2:CLOSE15:GOTO175
135 PRINT"[155][147]":PRINTTAB(13)D$;"":PRINT"BUDGET V.2"
140 PRINT"IS THIS DATE CORRECT? (Y/N)"
145 GETA$:IF A$=""THEN145
150 IF A$="Y"THEN175
155 IF A$<>"N"THEN145
160 PRINT"[147]ENTER NEW DATE 00/00/0000"
165 INPUT" ";D$
170 IFLEN(D$)<>10THEN160
175 PRINT"[147]";:PRINTTAB(14);"[213][178][192][192][192][192][192][192][192][192][192][178][201]"
180 PRINTTAB(3)"[155]BUDGET V.2 [221][221]MAIN MENU[221][221]";:PRINTTAB(28)"[146][155]"D$""
185 PRINTTAB(14);"[202][177][192][192][192][192][192][192][192][192][192][177][203][155]"
190 PRINTTAB(10)"POSTING[155]",,,,,,,
195 PRINTTAB(5)" 1 = BUDGET POSTING"
200 PRINTTAB(5)" 2 = AUTO-DEPOSIT",,,,,,
205 PRINTTAB(10)"REPORTS[155]",,,,,,,:PRINTTAB(5)" 3 = BALANCE REPORT"
210 PRINTTAB(6)" [158] F1 [146][155]--->PRINTER[155]"
215 PRINTTAB(5)" 4 = OTHER REPORTS",,,,,,:PRINTTAB(8)" MAINTENANCE[155]",,,,,,
220 PRINTTAB(5)" 5 = DATE CHANGE"
225 PRINTTAB(5)" 6 = LOAD DATA FROM DISK"
230 PRINTTAB(5)" 7 = SAVE DATA TO DISK"
235 PRINTTAB(6)"8 = EDIT MODE CAUTION-END PRG[155]"
240 PRINTTAB(5)" 9 = ZERO ACCOUNTS",,,,,,
245 PRINT" PRESS # KEY DESIRED"
250 A$=""
255 PRINT"[145] PRESS # KEY DESIRED "
260 GETA$:IFA$=""THENPRINT"[145][145]":GOTO245
265 IF(VAL(A$)<1ORVAL(A$)>9)AND(A$<>"[133]")THEN260
270 PRINT"[155]";
275 IFA$="[133]"THEN615
280 ONVAL(A$)GOTO285,545,615,1010,135,1685,1710,1595,1605
285 PRINT"[147]";"POSTING"
290 GOSUB70
295 P$=""
300 PRINT:INPUT"# OF ACCOUNT FOR POSTING";P$
305 IFP$=""THEN175
310 N=VAL(P$)
315 PRINT"[147]POSTING TO ACCOUNT #";N
320 NU=T(N,1):K$="XX,XXX.XX-":GOSUB1465
325 PRINT:PRINTC$(N):PRINT:PRINT"INCOME ";SPC(2);K$
330 NU=T(N,2):K$="XX,XXX.XX-":GOSUB1465
335 PRINT"EXPENSE ";SPC(2);K$
340 NU=INT(T(N,1)-T(N,2)):K$="XX,XXX.XX-":GOSUB1465
345 PRINT"BALANCE ";SPC(2);K$
350 PRINT:PRINT" + [146][155]=INCREASE INCOME":PRINT" - [146][155]=INCREASE EXPENSE"
355 PRINT" RET=RETURN TO MENU"
360 GETA$:IFA$=""THEN360
365 IFA$="+"THEN385
370 IFA$="-"THEN465
375 IFA$=""THEN290
380 GOTO290
385 PRINT:INPUT"AMOUNT TO INCREASE INCOME[155]";I
390 NU=T(N,1)+I:K$="XX,XXX.XX-":GOSUB1465
395 PRINT:PRINT"INCOME ";K$
400 NU=T(N,2):K$="XX,XXX.XX-":GOSUB1465
405 PRINT"EXPENSE ";K$
410 NU=INT(T(N,1)-T(N,2)+I):K$="XX,XXX.XX-":GOSUB1465
415 PRINT" [197][197][197][197][197][197][197][197][197][197]"
420 PRINT"BALANCE ";K$
425 PRINT"CORRECT Y/N?"
430 GETA$:IFA$=""THEN430
435 IFA$="N"THEN315
440 IFA$<>"Y"THEN430
445 T(N,1)=INT(T(N,1)+I)
450 IFN>24THENT(24,1)=INT(T(24,1)+I)
455 D(VAL(LEFT$(D$,2)),1)=INT(D(VAL(LEFT$(D$,2)),1)+I)
460 GOTO315
465 PRINT:INPUT"AMOUNT TO INCREASE EXPENSE[155]";I
470 NU=T(N,1):K$="XX,XXX.XX-":GOSUB1465
475 PRINT:PRINT"INCOME ";K$
480 NU=T(N,2)+I:K$="XX,XXX.XX-":GOSUB1465
485 PRINT"EXPENSE ";K$
490 NU=INT(T(N,1)-(T(N,2)+I)):K$="XX,XXX.XX-":GOSUB1465
495 PRINT" [197][197][197][197][197][197][197][197][197][197]"
500 PRINT"BALANCE ";K$
505 PRINT"CORRECT Y/N?"
510 GETA$:IFA$=""THEN510
515 IFA$="N"THEN315
520 IFA$<>"Y"THEN510
525 T(N,2)=INT(T(N,2)+I)
530 IFN>24THENT(24,2)=INT(T(24,2)+I)
535 D(VAL(LEFT$(D$,2)),2)=INT(D(VAL(LEFT$(D$,2)),2)+I)
540 GOTO315
545 PRINT"[147]";"AUTO-DEPOSIT"
550 NU=F:K$="XX,XXX.XX-":GOSUB1465
555 PRINTTAB(200)"ENTER DEPOSIT AMOUNT"
560 PRINT"***[155]DO NOT USE DECIMAL POINT***[155]"
565 PRINT"MUST BE AT LEAST $";K$;:INPUTDP$:IFDP$=""THEN175
570 DP=VAL(DP$)
575 B=0
580 RESTORE
585 FORN=1TO23:READQ:B=B+Q:T(N,1)=INT(T(N,1)+Q)
590 D(VAL(LEFT$(D$,2)),1)=INT(D(VAL(LEFT$(D$,2)),1)+Q):NEXT
595 D(VAL(LEFT$(D$,2)),1)=INT((D(VAL(LEFT$(D$,2)),1)+DP)-F)
600 T(24,1)=INT((T(24,1)+DP)-F)
605 T(25,1)=INT((T(25,1)+DP)-F)
610 GOTO175
615 PRINT"[147]";
620 RESTORE
625 BA=0
630 IFA$="[133]"THEN750
635 FORN=1TO24:BA=BA+INT((T(N,1)-T(N,2)))
640 IFN<10THENPRINT" ";
645 PRINTN;:PRINTLEFT$(C$(N),15);
650 IFN<24THENREADA:PRINTTAB(19)A/100;
655 NU=INT(T(N,1)-T(N,2)):K$="XX,XXX.XX-":GOSUB1465
660 PRINTTAB(24)K$
665 NEXT
670 GETA$:IFA$=""THEN670
675 IFA$="P"THENGOSUB1465
680 PRINT"[147]";
685 NU=INT(BA):K$="XX,XXX.XX-":GOSUB1465
690 PRINT"$"K$;" IS YOUR TOTAL FOR CHECKBOOK."
695 BA=0:PRINT:FORN=24TO40:PRINTN;LEFT$(C$(N),13);
700 NU=INT(T(N,1)-T(N,2)):K$="XX,XXX.XX-":GOSUB1465
705 IFN=24THENPRINTTAB(30)K$:MB$=K$
710 IFN>24THENPRINTTAB(20)K$
715 IFN>24THENBA=BA+INT((T(N,1)-T(N,2)))
720 NEXT
725 PRINT
730 NU=INT(BA):K$="XX,XXX.XX-":GOSUB1465
735 PRINTTAB(20)K$;:PRINTTAB(30)MB$:MB$=""
740 GETA$:IFA$=""THEN740
745 GOTO175
750 P=0:OPEN3,4
755 PRINT#3:IFNOTPEEK(144)AND128THENCLOSE3:GOTO780
760 PRINT" ***[155] PLEASE TURN THE PRINTER ON ***[155]":P=P+1
765 IFP>799THENCLOSE3:GOTO175
770 GOTO755
775 P=0
780 OPEN3,4
785 T5$=CHR$(16)+"05"
790 BB=0:BC=0
795 PRINT"PRINTING..."
800 PRINT#3,CHR$(14);
805 PRINT#3,SPC(16)"BALANCES";CHR$(15)
810 PRINT#3:PRINT#3
815 PRINT#3,SPC(35)D$;CHR$(13);CHR$(13)
820 T1$=CHR$(16)+"35"
825 T2$=CHR$(16)+"48"
830 T3$=CHR$(16)+"65"
835 T4$=CHR$(16)+"24"
840 PRINT#3,"ACCOUNT";T4$;"AMT";T1$;" BALANCE";
845 PRINT#3,T2$;" INCOME";T3$;" EXPENSES"
850 FORN=1TO24:BA=BA+(T(N,1)-T(N,2)):BB=INT(BB+T(N,1)):BC=INT(BC+T(N,2))
855 PRINT#3,T5$;LEFT$(C$(N),15);
860 IFN<24THENREADA:PRINT#3,T4$;A/100;
865 NU=INT(T(N,1)-T(N,2)):K$="XX,XXX.XX-":GOSUB1465
870 PRINT#3,T1$;K$;:NU=INT(T(N,1)):K$="XX,XXX.XX-":GOSUB1465
875 PRINT#3,T2$;K$;:NU=INT(T(N,2)):K$="XX,XXX.XX-":GOSUB1465
880 PRINT#3,T3$;K$
885 NEXT:PRINT#3
890 NU=BA:K$="XX,XXX.XX-":GOSUB1465
895 PRINT#3,CHR$(14);T5$;"TOTALS =";CHR$(15);T1$;K$;
900 NU=BB:K$="XX,XXX.XX-":GOSUB1465
905 PRINT#3,T2$;K$;
910 NU=BC:K$="XX,XXX.XX-":GOSUB1465
915 PRINT#3,T3$;K$
920 PRINT#3
925 NU=BA:K$="XX,XXX.XX-":GOSUB1465
930 PRINT#3,T5$;CHR$(14);"CHECKBOOK TOTAL = $"K$;CHR$(15)
935 BA=0:PRINT#3,:FORN=24TO40:PRINT#3,LEFT$(C$(N),15);
940 IFN=24THENNU=INT(T(N,1)-T(N,2)):K$="XX,XXX.XX-":GOSUB1465
945 IFN=24THENPRINT#3,T1$;" "LEFT$(K$,9)
950 IFN>24THENNU=T(N,2):K$="XX,XXX.XX-":GOSUB1465
955 IFN>24THENPRINT#3,T4$;K$
960 IFN>24THENBA=INT(BA+T(N,2))
965 NEXT
970 PRINT#3:PRINT#3,CHR$(14);"TOTALS";CHR$(15);
975 NU=BA:K$="XX,XXX.XX-":GOSUB1465
980 PRINT#3,T4$;" ";K$;
985 NU=INT(T(24,1)-T(24,2)):K$="XX,XXX.XX-":GOSUB1465
990 PRINT#3,T1$;" "LEFT$(K$,9)
995 PRINT#3,CHR$(12)
1000 CLOSE3
1005 GOTO175
1010 BA=0:BE=0:PRINT"[147]OTHER REPORTS"
1015 PRINT"[158] 1 [155][146]= SPREADSHEET":PRINT"[158] 2 [155][146]= MONTHLY GRAPHIC EXPENSE/INCOME"
1020 PRINT"[158] 3 [155][146]= WEEKLY GRAPHIC EXPENSE"
1025 PRINT"[158]RET[155][146]= MAIN MENU"
1030 GETA$:IFA$=""THEN1030
1035 IFA$=CHR$(13)THEN175
1040 IFVAL(A$)<1ORVAL(A$)>3THEN1030
1045 ONVAL(A$)GOTO1050,1195,1290
1050 PRINT"[147]";
1055 FORN=1TO24
1060 IFN<10THENPRINT" ";
1065 NU=T(N,1):K$="XX,XXX.XX-":GOSUB1465
1070 PRINTN;LEFT$(C$(N),13);TAB(18);K$;
1075 NU=T(N,2):K$="XX,XXX.XX-":GOSUB1465
1080 PRINTTAB(29)K$
1085 BA=INT(BA+T(N,1)):BE=INT(BE+T(N,2))
1090 NEXT
1095 NU=BA:K$="XX,XXX.XX-":GOSUB1465
1100 PRINTTAB(18);K$;
1105 NU=BE:K$="XX,XXX.XX-":GOSUB1465
1110 PRINTTAB(29);K$;
1115 GETA$:IFA$=""THEN1115
1120 PRINT"[147]";
1125 BA=0:BE=0:PRINT
1130 FORN=25TO40
1135 NU=T(N,1):K$="XX,XXX.XX-":GOSUB1465
1140 PRINTN;LEFT$(C$(N),13);TAB(18);K$;
1145 NU=T(N,2):K$="XX,XXX.XX-":GOSUB1465
1150 PRINTTAB(29);K$
1155 BA=BA+T(N,1):BE=BE+T(N,2)
1160 NEXT
1165 NU=BA:K$="XX,XXX.XX-":GOSUB1465
1170 PRINT:PRINTTAB(18);K$;
1175 NU=BE:K$="XX,XXX.XX-":GOSUB1465
1180 PRINTTAB(29);K$
1185 GETA$:IFA$=""THEN1185
1190 GOTO175
1195 PRINT"[147]MONTHLY[157][157][157][157][157][157][157][150]EXPENSE [146][157][157][157][157][157][157][157][157][157][157]INCOME [146][155]"
1200 PRINTTAB(2)"INC EXP"
1205 PRINT"J[157]F[157]M[157]A[157]M[157]J[157]J[157]A[157]S[157]O[157]N[157]D"
1210 PRINTTAB(15)"JAFB[146]MRAP[146]MYJN[146]JLAU[146]SPOC[146]NVDC"
1215 PRINT""TAB(15)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
1220 FORN=1TO20:PRINTTAB(15)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]":NEXT
1225 PRINT"":MAX=0:MIX=0
1230 FORN=1TO12:IFMAX<D(N,2)THENMAX=D(N,2)
1235 IFMIX<D(N,1)THENMIX=D(N,1)
1240 NEXT:IFMIX>MAXTHENMAX=MIX
1245 IFMA<=0THENPRINT"NO DATA AVAILABLE[155]";:GOTO1280
1250 FORN=1TO12:AV=(20/MAX)*D(N,1):X=ABS(INT(800/20*INT(AV))-800)+1184
1255 A1=(20/MAX)*D(N,2):X1=ABS(INT(800/20*INT(A1))-800)+1184
1260 PRINTTAB(2)INT(D(N,1)/100);TAB(8)INT(D(N,2)/100)
1265 FORI=1944TOXSTEP-40:POKEI+(N*2)-27,229:POKEI+(N*2)-27+54272,5:NEXT
1270 FORI=1944TOX1STEP-40:POKEI+(N*2)-27+1,231:POKEI+(N*2)-27+54272+1,10:NEXT
1275 NEXT
1280 GETA$:IFA$=""THEN1280
1285 GOTO175
1290 PRINT"[147]WHAT FACTOR ? ( 1 THRU 9 )
1295 [161]O$:[139]O$[178]""[167]1295
1300 O[178][197](O$):[139]O[179]1[176]O[177]9[167]1295
1305 [153]"LOAD FACTOR ="O:[153]"WEEKLYEXPENSE"
1310 [153]"
1315 PRINT" 12345678901234567890123 "
1320 PRINT""TAB(5)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
1325 FORN=1TO19:PRINTTAB(5)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
1330 NEXT
1335 PRINT""
1340 MAX=0
1345 FORN=1TO23:IFMAX<INT(T(N,2)/100)THENMAX=INT(T(N,2)/100)
1350 NEXT:IFMAX<=0THENPRINT"NO EXPENSE DATA":GOTO1380
1355 MAX=INT(MAX/O)
1360 FORN=1TO23:X=1909-INT(720*(T(N,2)/100)/MAX):IFX<1184THENX=1184:X9=1
1365 FORI=1909TOXSTEP-40:POKE(I+N),229:POKE(I+N)+54272,10
1370 IFX9=1ANDI<1222THENPOKE(I+N),158
1375 NEXT:X9=0:NEXT
1380 GETA$:IFA$=""THEN1380
1385 GOTO175
1390 PRINT"[155][147]SAVING ACCOUNT ";RIGHT$(D$,4)
1395 PRINT"PLEASE WAIT..."
1400 OPEN15,8,15,"I"
1405 GOSUB1440
1410 PRINT#15,"S:BUDGET DATA "+RIGHT$(D$,2)
1415 OPEN2,8,2,"0:BUDGET DATA "+RIGHT$(D$,2)+",S,W"
1420 FORN=1TO40:PRINT#2,T(N,1);CHR$(13):NEXT:GOSUB1440
1425 FORN=1TO40:PRINT#2,T(N,2);CHR$(13):NEXT:GOSUB1440
1430 FORN=1TO12:PRINT#2,D(N,1);CHR$(13):NEXT:GOSUB1440
1435 FORN=1TO12:PRINT#2,D(N,2);CHR$(13):NEXT:GOSUB1440:CLOSE2:CLOSE15:GOTO175
1440 INPUT#15,EN,EM$,ET,ES
1445 IFEN=0THENRETURN
1450 PRINT" ERROR ON DISK "
1455 PRINTEN;EM$;ET;ES
1460 CLOSE2:CLOSE15:GOTO1450
1465 REM MA ROUTINE
1470 N2=NU:NU=ABS(NU):LM=LEN(K$):L$=STR$(NU)
1475 LNU=LEN(L$):CN=LNU+1
1480 FORCT=LMTO1STEP-1:CN=CN-1
1485 IFCN<2THEN1575
1490 IFMID$(K$,CT,1)<>"-"THEN1530
1495 IFN2=>0THEN1515
1500 K$=MID$(K$,1,CT-1)+"-"
1505 CN=CN+1
1510 GOTO1525
1515 K$=MID$(K$,1,CT-1)+" "
1520 CN=CN+1
1525 GOTO1580
1530 IFMID$(K$,CT,1)=","THEN1545
1535 IFMID$(K$,CT,1)="."THEN1545
1540 GOTO1560
1545 CN=CN+1
1550 IFCT=2THENCN=CN-1
1555 GOTO1580
1560 M$=MID$(K$,1,CT-1)+MID$(L$,CN,1)+MID$(K$,CT+1,LM-(CT-1)-1)
1565 K$=M$
1570 GOTO1580
1575 K$=MID$(K$,1,CT-1)+" "+MID$(K$,CT+1,(LM-(CT-1)-1))
1580 REM PRINT CT;K$
1585 NEXTCT
1590 RETURN
1595 PRINT"[147]";:STOP
1600 GOTO175
1605 PRINT"[147]";"ZERO ACCOUNTS":PRINT
1610 PRINT"[158] 1 [155][146] = ZERO ALL ACCOUNTS"
1615 PRINT"[158] 2 [155][146] = ZERO EXPENSE AND CARRY BALANCE"
1625 PRINT"[158]RET[155][146] = MAIN MENU"
1630 GETA$:IFA$=""THEN1630
1635 IFA$=CHR$(13)THEN175
1640 IFVAL(A$)<1ORVAL(A$)>2THEN1630
1645 ONVAL(A$)GOTO1650,1660,175
1650 PRINT"[147]":FORN=1TO40:T(N,1)=0:T(N,2)=0:NEXT
1652 FORN=1TO12:D(N,1)=0:D(N,2)=0:NEXT:GOTO175
1660 PRINT"[147]":FORN=1TO24:T(N,1)=INT(T(N,1)-T(N,2))
1665 T(N,2)=0:NEXT:T(25,1)=T(24,1):T(25,2)=0
1670 FORN=26TO40:T(N,1)=0:T(N,2)=0:NEXT
1675 GOTO175
1685 PRINT"[147]LOAD DATA FOR ";:PRINTRIGHT$(D$,4);:PRINT" Y/N ?"
1690 GETA$:IFA$=""THEN1690
1695 IFA$="N"THEN135
1700 IFA$<>"Y"THEN1690
1705 GOTO85
1710 PRINT"[147]SAVE DATA FOR ";:PRINTRIGHT$(D$,4);:PRINT" Y/N ?"
1715 GETA$:IFA$=""THEN1715
1720 IFA$="N"THEN135
1725 IFA$<>"Y"THEN1715
1730 GOTO1390
1735 DATA0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000
1740 DATA0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000
1745 DATAAUTO-GAS/REPAIRS,AUTO-REGISTRATION,CABLEVISION,CLOTHING,ELECTRICITY
1750 DATAENTERTAINMENT,FOOD EXPENSE,HEAT-OIL,HOUSE REPAIRS,INS-AUTO/HOUSE
1755 DATAINS-DISABILITY,INS-LIFE,MEDICAL EXPENSE,MORTGAGE EXPENSE
1760 DATA NOTE EXPENSE,PROPERTY TAXES,SAVINGS ACCT,TELEPHONE
1765 DATAVACATION,X-MAS SAVINGS,"1","2","3"
1770 DATAMISCELLANEOUS,DEPOSITS,TRANSFERS,MISC 1,MISC 2,MISC 3
1775 DATAMISC 4,MISC 5,MISC 6,MISC 7,MISC 8
1780 DATAMISC 9,MISC 10,MISC 11,MISC 12,MISC 13,MISC 14